#include <iostream>
#include <cstdio>
using namespace std;
int n,k;
int main(){
	int sum1=0,cnt1=0;
	int sum2=0,cnt2=0;
	cin>>n>>k;
	for(int i=1;i<=n;i++){
		if(i%k==0){
			sum1+=i;
			cnt1++;
		}else{
			sum2+=i;
			cnt2++; 
		}
	}
	printf("%.1f %.1f",sum1*1.0/cnt1,sum2*1.0/cnt2);
	return 0;
}
